package com.xiguaji.tiktok.v1.ins.blogger.service;

import com.xiguaji.tiktok.v1.ins.blogger.model.TempBlogger;
import com.xiguaji.tiktok.v1.ins.blogger.repository.TempBloggerRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Optional;

@Service
public class TempBloggerService {

    @Autowired
    TempBloggerRepository tempBloggerRepository;

    public TempBlogger getByUsername(String username){
        Optional<TempBlogger> optionalTempBlogger = tempBloggerRepository.findByUsername(username);
        return optionalTempBlogger.isPresent()?optionalTempBlogger.get():null;
    }
}
